<?php
import("data.db.file.DbFileInfo");

class DbImageInfo extends DbFileInfo {
	
	public $className = "data.logic.file.ImageInfo";
	const CLASS_NAME = "data.logic.file.ImageInfo";
	
	const THUMBNAIL_DEFAULT	= 'no_thumbnail.jpg';
	
	public function __construct($noinit=false) {
		parent::__construct($noinit);
	}
	
	function getThumbnail() {
		$th_name = substr($this->repName, 0, -4)."_th.jpg";
		if (file_exists(REPOSITORY_PATH.DIRSEP.$th_name)) {
			return $th_name;
		} else {
			return null;
		}
	}
	
	// same for all classes
    public static function findAll() {return DbAbstractTable::findAll(self::CLASS_NAME);}
    public static function findById($id) {return DbAbstractTable::findById($id, self::CLASS_NAME);}
}
?>